package org.ee.core.handler.exception;

import org.springframework.http.HttpStatus;

import static org.springframework.http.HttpStatus.BAD_REQUEST;

/**
 * 统一异常处理
 */
public class BadRequestException extends RuntimeException{

    private Integer code = BAD_REQUEST.value();

    public BadRequestException(String msg){
        super(msg);
    }

    public BadRequestException(HttpStatus status,String msg){
        super(msg);
        this.code = status.value();
    }

    public Integer getStatus() {
        return code;
    }
}
